]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tools: Set XDG_DATA_DIRS inside toolbox run script
authorThomas Booker <tw.booker@outlook.com>
Mon, 23 Jun 2025 06:13:08 +0000 (18:13 +1200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 24 Jun 2025 14:40:03 +0000 (16:40 +0200)
Some host OSes (like NixOS) have a weird $XDG_DATA_DIRS environment
variable that gets inherited into the toolbox and brakes GSettings schemas.
Address this by appending the default /usr/share to $XDG_DATA_DIRS if
necessary.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3761>

tools/toolbox/run-gnome-shell.sh

index 23b1186b57eeb86b31ced2db5f38e3ff93aaafa5..a74c41eb4f3edc8b72f1eb7faabdfba7c8eebc62 100755 (executable)
@@ -64,6 +64,13 @@ TOOLBOX=$DEFAULT_TOOLBOX
 SHELL_ENV=(XDG_CURRENT_DESKTOP=GNOME)
 SHELL_ARGS=()
 
+# Some host OSes (like NixOS) have a weird $XDG_DATA_DIRS environment variable
+# that breaks GSettings schemas. Make sure it is set to something sensible.
+if [[ ! :$XDG_DATA_DIRS: =~ :/usr/share/?: ]]
+then
+  SHELL_ENV+=(XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share/)
+fi
+
 TEMP=$(getopt \
  --name $(basename $0) \
  --options '20t:vh' \